linux: Adjust memory allocation condition in netback to reduce memory
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 12 Mar 2007 14:55:02 +0000 (14:55 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 12 Mar 2007 14:55:02 +0000 (14:55 +0000)
pressure on Xen and avoid unnecessarily stalling receives.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
linux-2.6-xen-sparse/drivers/xen/netback/netback.c

index b05e3000e3783735d999f103c0c45e0d825312e8..7e0c3408326603a70a358572b000f517407ca547 100644 (file)
@@ -110,6 +110,7 @@ static unsigned int alloc_index = 0;
 
 static inline unsigned long alloc_mfn(void)
 {
+       BUG_ON(alloc_index == 0);
        return mfn_list[--alloc_index];
 }
 
@@ -552,6 +553,7 @@ static void net_rx_action(unsigned long unused)
                *(int *)skb->cb = nr_frags;
 
                if (!xen_feature(XENFEAT_auto_translated_physmap) &&
+                   !((netif_t *)netdev_priv(skb->dev))->copying_receiver &&
                    check_mfn(nr_frags + 1)) {
                        /* Memory squeeze? Back off for an arbitrary while. */
                        if ( net_ratelimit() )